<script setup lang="ts">
import { ref, watch } from 'vue';

  const totalCount = ref(0)
  const msg = ref('震惊 !')
  

  watch([totalCount,msg],()=>{
    console.log('totalCount更新',totalCount.value)
    console.log('震惊',msg)
  })
</script>
<template>
  <div>{{ totalCount }}</div>
  <div>{{ msg }}</div>
  <button @click="totalCount++">加1</button>
  <button @click="msg += '!'">震惊加！</button>
</template>
<style scoped>
  
</style>

